< previous page page_10 next page >

Page 10
z0030-01.gif
Figure 1.3
The Left, Top, Width, and Height properties
determine an object's size and position.
Interior Sizing
For both forms and controls, the difference between Width and Height, on one hand, and ScaleWidth and ScaleHeight on the other can cause some confusion. For example, suppose you want to draw a picture on a form using custom coordinates with 0 <= X <= 100 and 0 <= Y <= 100. Suppose also that you want the picture to be one inch square.
If you set both the Width and Height to 1440 twips (1 inch), the actual drawing area will be somewhat smaller because the form must use some of its 1 square inch for borders. Even more of the form's height is removed for its title bar. That makes the drawing area slightly wider than it is tall. If you now define the custom coordinates 0 <= X <= 100 and 0 <= Y <= 100, your picture appears slightly flattened. Squares are a little too short and wide to be square.
The easiest way to deal with this mess is to use the form itself to figure out how large the borders and title bar will be. When you are ready to size the form, compute the difference between the Width and ScaleWidth properties. That is the amount used by the form for its side borders. Similarly, compute the difference between the form's Height
0010-02.jpg
Figure 1.4
The relationship between Width, ScaleWidth
and between Height and ScaleHeight.

 
< previous page page_10 next page >